package com.dudy.spring1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author <a href="mailto:wb-zhaojunwei@alibaba-inc.com">wb-zhaojunwei</a>
 * @version 1.0
 * @Description
 * @Since 2016/5/25
 */
public class MainTest {
    public static void main(String[] args) {
        /*BeanFactory是spring父容器，applicationContext是spring子容器，当容器创建并加载时，会自动调用容器事件监听applicationListener*/
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        /*当然我们也可以手动触发事件*/
        SpringSubject ss = new SpringSubject("hello world", "杭州", "杭州欢迎你");
        context.publishEvent(ss);
    }
}
